﻿package mortal.game.view.common.tooltip.tooltips
{
    import com.mui.controls.*;
    import extend.language.*;
    import mortal.common.global.*;
    import mortal.game.resource.*;
    import mortal.game.resource.tableConfig.*;
    import mortal.game.view.common.*;
    import mortal.game.view.common.util.*;

    public class ToolTipJewelStone extends ToolTipBaseItem
    {
        private var _txtBasic2:GTextFiled;
        private var _basicAttr:GTextFiled;
        private var _strengAttr:GTextFiled;

        public function ToolTipJewelStone()
        {
            return;
        }// end function

        override public function set data(param1) : void
        {
            var _loc_8:int = 0;
            var _loc_9:String = null;
            super.data = param1;
            if (_data.itemInfo.itemLevel > 0)
            {
            }
            var _loc_2:* = _txtLv.getTextByIndex(0);
            _loc_2.textColor = 15976798;
            _loc_2.text = Language.getStringByParam(20782, EquipmentUtil.getGemCombat(_data));
            var _loc_3:* = EquipJewelMatchConfig.instance.getEquipTypeByJewelType(_data.itemInfo.type);
            var _loc_4:* = Language.getString(20763);
            if (_loc_3 != null || _loc_3.length > 0)
            {
                _loc_4 = "";
                _loc_8 = 0;
                while (_loc_8 < _loc_3.length)
                {
                    
                    _loc_9 = GameDefConfig.instance.getEquipName(int(_loc_3[_loc_8]));
                    if (_loc_8 != (_loc_3.length - 1))
                    {
                        _loc_4 = _loc_4 + (_loc_9 + "、");
                    }
                    else
                    {
                        _loc_4 = _loc_4 + _loc_9;
                    }
                    _loc_8++;
                }
            }
            _txtLv.setText(2, Language.getStringByParam(20802, _loc_4));
            var _loc_5:* = GameDefConfig.instance.getItem("FightRoleAttribute", _data.itemInfo.type).text;
            _loc_5 = _loc_5 == "maxLife" ? ("life") : (_loc_5);
            var _loc_6:* = AttributeUtil.transferAttrName(_loc_5);
            var _loc_7:* = _data.itemInfo.effect;
            this._basicAttr.text = _loc_6 + "：" + _loc_7;
            if (_data.extInfo && _data.extInfo.currentStrengthen > 0)
            {
                this._strengAttr.text = "(+" + _data.extInfo.currentStrengthen + ")";
            }
            else
            {
                this._strengAttr.text = "";
            }
            return;
        }// end function

        override protected function createChildren() : void
        {
            super.createChildren();
            var _loc_1:* = UIFactory.gTextField("", 0, 96, 100, 20, this);
            _loc_1.textColor = 16743974;
            _loc_1.text = Language.getString(20803);
            this._txtBasic2 = UIFactory.gTextField(Language.getString(20214), 70, 96, 160, 20, this);
            this._basicAttr = UIFactory.gTextField("", 0, 96 + 25 - 7, 80, 20, this);
            this._strengAttr = UIFactory.gTextField("", 70 + 15, 96 + 25 - 7, 80, 20, this, GlobalStyle.textFormatLv);
            _txtDesc.y = _txtDesc.y + 25;
            return;
        }// end function

    }
}
